package main

import (

	"github.com/mohuani/bubble/dao"
	"github.com/mohuani/bubble/models"
	"github.com/mohuani/bubble/routers"
)

func main() {
	// 数据库连接
	// sql: create database bubble;
	err := dao.InitMySQL()
	if err != nil {
		panic(err)
	}
	defer dao.Close()

	// 模型绑定
	dao.DB.AutoMigrate(&models.Todo{})

	r := routers.SetupRouters()
	r.Run()
}






















